package com.xzy.spring.config;

import com.xzy.spring.business.entity.UserEntity;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

/**
 * @author xzy
 * @date 2021-02-14 20:45
 * 说明：
 */
@Configuration
public class ProfileConfig {

    @Profile("dev")
    @Bean
    public UserEntity devUserEntity() {
        return new UserEntity("dev", 20);
    }

    @Profile("test")
    @Bean
    public UserEntity testUserEntity() {
        return new UserEntity("test", 20);
    }

    @Profile("prod")
    @Bean
    public UserEntity prodUserEntity() {
        return new UserEntity("prod", 20);
    }
}
